UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tq6J2Kxed4MKYp4aMOZdein3ARaref/pROCD9OACdqE='
WHERE
key_id = '0ca95f286a2f32f5a96ba74e2990a21c7c8def77d06f2910c7351e3d74ef1e21'
AND (
token = 'tq6J2Kxed4MKYp4aMOZdein3ARaref/pROCD9OACdqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)