UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pOMhNEtlTQSxuzt1/bHZOp89cgDllRkV3R+bXqD2jw4='
WHERE
key_id = 'a37205b76f8dc4c09dd1d545c26f280473183e6b0e179a6be9306680ffd7e591'
AND (
token = 'pOMhNEtlTQSxuzt1/bHZOp89cgDllRkV3R+bXqD2jw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)