UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qZJ+IeV/I82Skya5F1JgHkTNYybTaBL0Ir6rYd5g6Y0=' 
WHERE 
  key_id = '910541abf1791dd788c776a6e837295a2ee5be0c7801a30300efc69f27279abf' 
  AND (
    token = 'qZJ+IeV/I82Skya5F1JgHkTNYybTaBL0Ir6rYd5g6Y0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023