UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8zpclay3miuFaEI4cZPuPXaMOqHahN+J/ZV0eUMCvRQ=' 
WHERE 
  key_id = '54e7069cda06e7d3cc59d8c0897a0b4cd3b9124f76fd9e7e92f2948efa9c671a' 
  AND (
    token = '8zpclay3miuFaEI4cZPuPXaMOqHahN+J/ZV0eUMCvRQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019