UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bzOYODObUS2IQrbdLKHlq82lQKhxguQpaPzRJdE2wQA='
WHERE
key_id = '26da3e7805735782ce538665724f7bb6e7ca75fcce85c1841484af5384a4a34c'
AND (
token = 'bzOYODObUS2IQrbdLKHlq82lQKhxguQpaPzRJdE2wQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)