UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ffp3dYAsTR1NN1nvUGuUOaIb4V3nGRfRxYnO7LKPkM='
WHERE
key_id = '8c1f0a496fd60347b0739ff57634bfd87af4078c674a04e79c5846aaaac6c459'
AND (
token = '2ffp3dYAsTR1NN1nvUGuUOaIb4V3nGRfRxYnO7LKPkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)