UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6L6CzmDFTJAS+UFFddpHS4EeAd+Oy3JzHkT2wiVqOag=' 
WHERE 
  key_id = 'e309db0b3bef04fa84c7088e9d469ceab2892ce6908c1e515404cb59b6f1fbe5' 
  AND (
    token = '6L6CzmDFTJAS+UFFddpHS4EeAd+Oy3JzHkT2wiVqOag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025