UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a+wJTp+RWIV4WTSIqIZeW21WiSqlfeToSEIVj5t28eU=' 
WHERE 
  key_id = 'eb290a9e3c4c07e2d8182b4d4134882f3d6f92b7b8f77f5a08113b8e75000bc6' 
  AND (
    token = 'a+wJTp+RWIV4WTSIqIZeW21WiSqlfeToSEIVj5t28eU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034