UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zcaVn/tWzAPloGuH3UYmva9kJjECz4gX3Rzve/D8zaY=' 
WHERE 
  key_id = '14b7afa4d239ec2fead9062ebb644d59b44b41fb09b11a364f19199e8d868b09' 
  AND (
    token = 'zcaVn/tWzAPloGuH3UYmva9kJjECz4gX3Rzve/D8zaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040