UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p/hYCJXg37alL/3Hkbkz5GXWsJqzYysX3uXTKGIfBHw='
WHERE
key_id = 'a1515d4d59875e523ff283ae1b5fbefea58fd4de4c5a8a8d91c8ed5835edef83'
AND (
token = 'p/hYCJXg37alL/3Hkbkz5GXWsJqzYysX3uXTKGIfBHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)