UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ppy0+h/ajiBX2lJKJBLzrpKMhSu05LyS7pEc36rngKg=' 
WHERE 
  key_id = '328a74135c93c07b380a2833063f15395e43bbbe13e04a4f33bba97bcd9c0105' 
  AND (
    token = 'Ppy0+h/ajiBX2lJKJBLzrpKMhSu05LyS7pEc36rngKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015