UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WG2TK2Q0jGHwDy9kZJB8Yf59pKS8+NdJ/oqvXU0eKR4=' 
WHERE 
  key_id = 'cb0a55da2fe3c8cc7c5f2dc9af1cbc4aa943c9a326fa452c6507de7da42fedb9' 
  AND (
    token = 'WG2TK2Q0jGHwDy9kZJB8Yf59pKS8+NdJ/oqvXU0eKR4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038