UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j5vXEQQ3FV8OTIqOfNnGahunoBW4FV/7Huy/cb4WA0M=' 
WHERE 
  key_id = 'f9d30afca7ddd6a16e80f102a7cecd5e6b584e502f9e185cc822a5f15c2a7f9c' 
  AND (
    token = 'j5vXEQQ3FV8OTIqOfNnGahunoBW4FV/7Huy/cb4WA0M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032