UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yjZC2lqN3qYD7N2VriMoQXnB/D3T3GYradEfhlS7G9c='
WHERE
key_id = '132c8ca2cbf7499ad7b404bfc10bf8f2a963c066b5255b6c29a388ff4f787338'
AND (
token = 'yjZC2lqN3qYD7N2VriMoQXnB/D3T3GYradEfhlS7G9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)