UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sEAV30z2nCNZvd02mFwiqt65b733S/8EF2sc4ktSOMs='
WHERE
key_id = '969d7fc77eb9692edcf076fd0fc4f2dbd179e87a28e4d626d2dfe88173bd61e9'
AND (
token = 'sEAV30z2nCNZvd02mFwiqt65b733S/8EF2sc4ktSOMs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)