UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ytw55HDeWy0YkuEHdpy5BXsv9BNDrNApPNu6ibmYtr4=' 
WHERE 
  key_id = '3c30ff0157aae0b2e09aed843a7328364d5d33133ca138d844943a5f703272a0' 
  AND (
    token = 'ytw55HDeWy0YkuEHdpy5BXsv9BNDrNApPNu6ibmYtr4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027