UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zEBsAoVmBG+93CpdvyB0onzIip1S+ka9Fadb9z3nPig='
WHERE
key_id = '5b1c113c3776d7ef94f03ae8a5cb53b6bae1383de6689ee65b425a1b6cc3fcca'
AND (
token = 'zEBsAoVmBG+93CpdvyB0onzIip1S+ka9Fadb9z3nPig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)