UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tfOk3x0CTuEf+i7/ggmMR0+TroFF6pFUZRQ0JpBdkHA='
WHERE
key_id = '7e9dfd7ff1b403c9fe9096e2f0646a069e6e2b2359c5ba26bbb05e45ff3b73d3'
AND (
token = 'tfOk3x0CTuEf+i7/ggmMR0+TroFF6pFUZRQ0JpBdkHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)