UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+D6XVEwxvfTMiyXfGCN4XsjdYlVHkK7DMlKUuMmTMPQ=' 
WHERE 
  key_id = '527e6339021ba12de3d1af98d95a8d6f00165644ecffa22f704fc2f0db130ada' 
  AND (
    token = '+D6XVEwxvfTMiyXfGCN4XsjdYlVHkK7DMlKUuMmTMPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028