UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+hxtI9zT4Pq+9sSaDHf8ERHFNvsWj1ScUE4yJX+R5Rw=' 
WHERE 
  key_id = '8a8a263186fa21a8feb076e5da8c7055474bae39ad6dc26965b1b7d454080912' 
  AND (
    token = '+hxtI9zT4Pq+9sSaDHf8ERHFNvsWj1ScUE4yJX+R5Rw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053