UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mjEXdVDm+xT9jr9j6tyaSB8MQA60Z7zax+uiL95Y30U=' 
WHERE 
  key_id = '290ed275c995393c89ce725089bada2f5818c5e30dc060ede2e140b22b19976b' 
  AND (
    token = 'mjEXdVDm+xT9jr9j6tyaSB8MQA60Z7zax+uiL95Y30U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035