UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DjtsRW9b6U9zJkQiytuepJUJZiNsL9MRF4AmrN0yQpM='
WHERE
key_id = '29ec3b44ef2dd7b4fb0066b24dc6c8b3f8711e06b31d959ff8ebada767eee9a8'
AND (
token = 'DjtsRW9b6U9zJkQiytuepJUJZiNsL9MRF4AmrN0yQpM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)