UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tbxReGPqZlyKizpC7QKPnCPUkqswhxqh2up8YVhXaHI=' 
WHERE 
  key_id = 'd80ac0ad12a86bf035aca22c84719000d934ab35d9efc34bb4b03b3c205a658c' 
  AND (
    token = 'tbxReGPqZlyKizpC7QKPnCPUkqswhxqh2up8YVhXaHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059