UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YtsgpzYYP4QpOAqVmUWF3T1SS+s+LU11fPYyfXt8maY='
WHERE
key_id = '444df6c7571776b4ef1323aa377639b5c63c618b0ceb57685faf91b53bc859e8'
AND (
token = 'YtsgpzYYP4QpOAqVmUWF3T1SS+s+LU11fPYyfXt8maY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)