UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X5EhzOBELz/ZqpuuL5XzbVB2y+8Ya/WQjL5C31PBYB8='
WHERE
key_id = '07fcae789a0edee152861ce1d77ff7de371c1b4495a029d74694707d1435f102'
AND (
token = 'X5EhzOBELz/ZqpuuL5XzbVB2y+8Ya/WQjL5C31PBYB8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)