UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gdgm/6Rl3FiGhK7FFwUDfKhmPHjpA0KWYpdJfkAt0gE='
WHERE
key_id = '94a7c8db08c34e5b8009e3376eab9b5572192c7cbaac6ac292eaecbf67aac51f'
AND (
token = 'gdgm/6Rl3FiGhK7FFwUDfKhmPHjpA0KWYpdJfkAt0gE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)