UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YrEJz0+LnUX+I3hWxHy7GABHYbBbzGk4K6GLovIHEaM='
WHERE
key_id = '29722f525cd606163c894281d73fe7dbbf7b8f22937383424dcb0b0cbb8b1bbd'
AND (
token = 'YrEJz0+LnUX+I3hWxHy7GABHYbBbzGk4K6GLovIHEaM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)