UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DBfk4gi1RjMzD4rRRR/VW7E9UJro8wChpi2FDnrVOCY='
WHERE
key_id = 'dadcd62c0044c01394c53d5b97e2f49e2f27e37db3e4897036f2d07a7f9ad422'
AND (
token = 'DBfk4gi1RjMzD4rRRR/VW7E9UJro8wChpi2FDnrVOCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)