UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Di6pL4FStDxfzgoQvxyCLT56Q+OBSsgVCLqPSERYwFA='
WHERE
key_id = 'c88a50f40d10fa92410ac71691a980f26f93fc8d8dc20cc469f9f4037918ca4f'
AND (
token = 'Di6pL4FStDxfzgoQvxyCLT56Q+OBSsgVCLqPSERYwFA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)