UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x0MFFKeNObDhHHDP2fqlFvoNnvqGdOfyebJaQbvpzr4='
WHERE
key_id = '403eb1eefe5eb2ebda183d8d9c4d1e28a915d6df86ac1de4c94bb29c5ce4a0a0'
AND (
token = 'x0MFFKeNObDhHHDP2fqlFvoNnvqGdOfyebJaQbvpzr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)