UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lKZjIdvk3HFOCHyIbegiXe7PzMBfqefZ7pB9n/nPnII='
WHERE
key_id = '10b3143d58cf9efae9650c24199a5f3227c8b1ef19b5adf5f6ee72ae1dace174'
AND (
token = 'lKZjIdvk3HFOCHyIbegiXe7PzMBfqefZ7pB9n/nPnII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)