UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '36+B+qy5hDhSO70DqaXHUwitYHQ0SwUwbyBqqArSR2s='
WHERE
key_id = 'cd0e9e3adad2a68d65ce97d8cbf692ca1be6778c51c01129dc2ef8ffd586b4cb'
AND (
token = '36+B+qy5hDhSO70DqaXHUwitYHQ0SwUwbyBqqArSR2s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)